﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="~/layui/css/layui.css" rel="stylesheet" />
    <link href="~/layuimini/css/public.css" rel="stylesheet" />
    <style>


    </style>
</head>
<body>
    <div class="layuimini-container">
        <div class="layuimini-main">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>审核列表</legend>
            </fieldset>
            <table class="layui-hide" id="table" lay-filter="currentTableFilter"></table>
            <script type="text/html" id="currentTableBar">
                <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">设置流程</a>
            </script>
        </div>
    </div>
    <script src="~/layui/layui.js"></script>
    <script>
    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;

        table.render({
            elem: '#table',
            method:'post',
            url: '@Url.Action("AuditingListAsync", "BasicInfo")',
            cols: [[
                {type: "checkbox", width: 50},
                { type: 'numbers', title: '序号', width: 50 },
                { field: 'Name', title: '名称' },
                { field: 'Remark', title: '审核流程' },
                { fixed: 'right', title: '操作', toolbar: '#currentTableBar', width: 150 }
            ]],
            limits: [10, 20, 30, 50, 100, 100000000],
            limit: 20,
            page: false,
            //skin: 'line',
            //totalRow: true,
            height: 'full-170',
            //size:'sm',
        });

        /**
         * toolbar监听事件
         */

        table.on('tool(currentTableFilter)', function (obj) {
            var data = obj.data;
            if (obj.event === 'edit') {

                var index = layer.open({
                    title: '修改审核流程',
                    type: 2,
                    shade: 0.2,
                    maxmin:true,
                    shadeClose: false,
                    area: ['900px', '600px'],
                    content: '@Url.Action("AuditingFlowList", "BasicInfo")' + '?ID=' + data.ID,
                    end: function () {
                        RefreshTable();
                    }
                });
                $(window).on("resize", function () {
                    layer.full(index);
                });
                return false;
            } 
        });
        function RefreshTable() {
            table.reload('table', {
                where: {
                    Search: ''
                }
            }, 'data');

        }
    });
    </script>
</body>
</html>